import { _decorator, Component, Node } from 'cc';
import { EffectBase } from './EffectBase';
const { ccclass, property } = _decorator;
export class EffectClassUtil{
    private static _effectClassUtii:EffectClassUtil=null;
    static get instance(){
        if(!this._effectClassUtii){
            this._effectClassUtii=new EffectClassUtil();
        }
        return this._effectClassUtii;
    }
    private _classMap:Map<string,EffectBase>=new Map();

    register(effectname:string,effectBase:EffectBase){
        this._classMap.set(effectname,effectBase);
    }

    get(effectname:string){
        this._classMap.get(effectname);
    }
    createEffectInstance(effectClassName:string){
        if(effectClassName.length<=0){
            return;
        }
        let effectClass=this._classMap.get(effectClassName);
        if(!effectClass){
            console.log("未找到该效果")
            return;
        }
        return effectClass;
    }
}

